package mn.idax.exchange.otc.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;


@AllArgsConstructor
@Getter
public enum TimeUnitEnum {

    HOUR("hour", 3600000L,"yyyy-MM-dd HH"),

    MINUTE("minute", 60000L,"yyyy-MM-dd HH:mm"),

    DAY("day", 86400000L,"yyyy-MM-dd");


    private String timeUnit;

    private Long millisecond;
    private String format;

    public static TimeUnitEnum getMillisecond(String timeUnit){
        TimeUnitEnum[] values = TimeUnitEnum.values();
        for (TimeUnitEnum value : values) {
            if(value.getTimeUnit().equalsIgnoreCase(timeUnit)){
                return value;
            }
        }
        return null;
    }


}
